<?php

use think\facade\Route;

/* 
Base
    注册
    登录
    登录验证
    修改资料
    充值中心
    充值记录
    消费记录
*/
// any => get post
Route::group('user/base', function () {
    Route::post('register', 'User.base/register');
    // user/base/login => user.base/login 登录POST路由
    Route::post('login', 'User.base/login');
    Route::post('check', 'User.base/check');
    Route::post('profile', 'User.base/profile');
    Route::post('email', 'User.base/email');
    Route::post('emailcode', 'User.base/emailcode');
    Route::post('pay', 'User.base/pay');
    Route::post('payrecord', 'User.base/payrecord');
    Route::post('record', 'User.base/record');
});

/* 
    收货地址 api
        列表
        添加
        切换默认地址
        详情
        编辑
        删除
        订单结算获取默认收货地址
*/
Route::group('user/address', function () {
    Route::post('index', 'User.address/index');
    Route::post('add', 'User.address/add');
    Route::post('select', 'User.address/select');
    Route::post('info', 'User.address/info');
    Route::post('edit', 'User.address/edit');
    Route::post('delete', 'User.address/delete');
    Route::post('order', 'User.address/order');
});

/* 
    商品接口
        列表
        详情
*/
Route::group('product/product', function () {
    Route::post('index', 'Product.product/index');
    Route::post('info', 'Product.product/info');
});

/* 
    分类接口
*/
Route::group('product/type', function () {
    Route::post('index', 'Product.type/index');
});

/* 
    购物车接口
        购物车列表
        添加购物车
        购物车商品数量
*/
Route::group('product/cart', function () {
    Route::post('index', 'Product.cart/index');
    Route::post('add', 'Product.cart/add');
    Route::post('stepper', 'Product.cart/stepper');
    Route::post('del', 'Product.cart/del');
    Route::post('confirm', 'Product.cart/confirm');
});

/* 
    订单接口
        订单列表
        订单新增（购物车）
        订单新增（立即购买）
        申请退货
        确认收货
        立即评价
        删除订单
*/
Route::group('order/order', function () {
    Route::post('index', 'Order.order/index');
    Route::post('add', 'Order.order/add');
    Route::post('gain', 'Order.order/gain');
    Route::post('info', 'Order.order/info');
    Route::post('after', 'Order.order/after');
    Route::post('receipt', 'Order.order/receipt');
    Route::post('rate', 'Order.order/rate');
    Route::post('del', 'Order.order/del');
});

/* 
    微信小程序接口
        登录
        绑定
        注册
        修改资料
*/
Route::group('user/auth', function () {
    Route::post('login', 'User.auth/login');
    Route::post('bind', 'User.auth/bind');
    Route::post('register', 'User.auth/register');
    Route::post('profile', 'User.auth/profile');
    Route::post('info', 'User.auth/info');
    Route::post('avatar', 'User.auth/avatar');
});
/* 
    预约服务
*/
Route::group('project/project', function () {
    Route::post('index', 'Project.project/index');
});
/* 
    预约订单
        订单列表
        新增订单
        确认支付
        撤销预约
        取消撤销
        评分
        删除
*/
Route::group('project/order', function () {
    Route::post('index', 'Project.order/index');
    Route::post('add', 'Project.order/add');
    Route::post('pay', 'Project.order/pay');
    Route::post('info', 'Project.order/info');
    Route::post('revoke', 'Project.order/revoke');
    Route::post('cancel', 'Project.order/cancel');
    Route::post('rate', 'Project.order/rate');
    Route::post('del', 'Project.order/del');
});
/* 
    react
*/
Route::group('card/type', function () {
    Route::post('index', 'Card.type/index');
});
Route::group('card/order', function () {
    Route::post('index', 'Card.order/index');
});

Route::group('card/card',function(){
    Route::post('card','Card.card/card');
    Route::post('add','Card.card/add');
    Route::post('index','Card.card/index');
    Route::post('pay','Card.card/pay');
});